<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>图片</title>
	</head>
	<body>
		<canvas id="canvas" width="1200" height="1000" style="width: 800px;height: 600px;"></canvas>
		<script type="text/javascript">
			var canvas = document.querySelector("#canvas")
			var ctx = canvas.getContext('2d')
			
			var img = new Image()
			img.src = "img/biqibao.jpg"
			img.onload = function(){
				ctx.drawImage(img,0,0)
			}
		</script>
	</body>
</html>
